package com.nine.system.controller;


import com.nine.common.tool.ResponseResult;
import com.nine.system.service.AccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/account")
@Api(tags = "账号设置Api",description = "提供账号方面的api")
public class AccountController {

    @Autowired
    private AccountService accountService;


    @PostMapping("/changePassword")
    @ApiOperation(value = "各个角色共用的修改密码接口")
    @ApiImplicitParams({
            @ApiImplicitParam(value="原密码",name="originPwd",dataType="Stirng",paramType = "query"),
            @ApiImplicitParam(value="新密码",name="afterPwd",dataType="Stirng",paramType = "query")
    })
    public ResponseResult changePassword(@RequestParam("originPwd")String originPwd,
                                         @RequestParam("afterPwd")String afterPwd){
        return accountService.changePassword(originPwd, afterPwd);
    }
}
